<template>
    <fieldset>
        <legend>商品详情</legend>
        <ul>
            <li v-for="(item) in arr" :key="item.id">
                <b>商品名称:{{item.title}}</b>
                ----------
                <b>价格:{{item.price}}</b>
                ----------
                <b>数量:{{item.inventory}}</b>
                -----
                <button :disabled="item.inventory===0" @click="GETARR(item)">加入购物车</button>
            </li>
        </ul>
        <button @click="aaa">aaa</button>
    </fieldset>


</template>
<script>
import { mapActions,mapState } from 'vuex';
    export default{
        data () {
            return {
            }
        },
        mounted () {
            this.GETMSG()

        },
        methods:{
            ...mapActions(['GETMSG']),
            ...mapActions('shop',['GETARR']),
            aaa(){
                // this.$nextTick(()=>{
                console.log(this.arr);
            // })
            }
        },
        computed:{
            ...mapState(['arr']),
        }
    }


</script>